package com.fs.model;

import lombok.*;

import java.util.ArrayList;
import java.util.List;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class Path {
    private String pathName; //
    private Path parent;  //父目录路径名
    private List<Path> children;//

    public Path(String pathName, Path parent) {
        this.pathName=pathName;
        this.parent=parent;
        this.children=new ArrayList<>();
    }
   public boolean hasChild() {
        return children.isEmpty() ? false : true;
    }
    public boolean hasParent() {
        return (parent == null) ? false : true;
    }

    public void addChildren(Path child) {
        children.add(child);
    }
    public void removeChildren(Path child) {
        this.children.remove(child);
    }
}
